package com.lmk.homework;

import java.util.Scanner;
/**
 *  根据输入金额依次输出 金额并计算总金额
 */

public class work01 {
    public static void main(String[] args) {
        System.out.println("请输入会员消费金额");




        Scanner in = new Scanner(System.in);

        double[] b=new double[6];

        for(int i=1;i<b.length;i++){
            System.out.println("请输入第"+i+"笔消费：");
            b[i]=in.nextInt();

        }

//遍历
        System.out.println("序号"+"           "+"金额（元）");
        for(int i=1;i<b.length;i++){

            System.out.println(i+"          "+b[i]);

        }
        double sum=0;
        for (double i:b
             ) {
            sum+=i;
        }
        System.out.println("总金额"+"           "+sum);
    }

}



